{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--搜索框开始-->
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item">

                        <div class="layui-col-md6 layui-input-inline" style="margin-top: 5px">
                            <input type="text" id="school" class="layui-input search" name="school" value="" placeholder="学校名字"/>
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select name="type" lay-search="" class="layui-input">
                                <option value="">所有类型</option>
                                <option value="1">仅收集</option>
                                <option value="2">仅支付</option>
                                <option value="3">支付和收集</option>
                            </select>
                        </div>
                        <div class="layui-input-inline" style="margin-top: 5px">
                            <button class="layui-btn" lay-submit="" lay-filter="LAY-search">立即搜索</button>
                            <button  class="layui-btn layui-btn-normal" id="empty"  lay-submit="" lay-filter="LAY-search">重置</button>
                        </div>
                    </div>
                </div>
                <!--搜索框结束-->
                <!--操作框开始-->
                <!--操作框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>
                    <script type="text/html" id="money">
                        {{# if(d.usetype >= 2){ }}
                            {{# if(d.money > 0){ }}
                            {{d.money}}
                            {{# } }}
                            {{# if(d.money <= 0){ }}
                            自定义
                            {{# } }}
                        {{# } }}
                        {{# if(d.usetype <= 1){ }}
                            不需要付款
                        {{# } }}
                    </script>
                    <script type="text/html" id="type">
                        {{# if(d.usetype == 1){ }}
                        仅收集
                        {{# } }}
                        {{# if(d.usetype == 2){ }}
                        仅支付
                        {{# } }}
                        {{# if(d.usetype == 3){ }}
                        支付和收集
                        {{# } }}
                    </script>
                    <script type="text/html" id="yes">
                        {{# if(d.yes == 1){ }}
                        待审核
                        {{# } }}
                        {{# if(d.yes == 2){ }}
                        已同意
                        {{# } }}
                        {{# if(d.yes == 3){ }}
                        已拒绝
                        {{# } }}
                    </script>

                    <!--操作模板-->
                    <script type="text/html" id="opeBar">
                        {{# if(d.yes == 1){ }}
                        <a href="javascript:;" onclick="wk.confirm('{{d.id}}','{:url('yesyes')}','确认同意吗？')" class="btn btn-primary btn-xs m-r-xs" title="同意"><i class="fa fa-check">同意</i></a>
                        <a href="javascript:;" onclick="wk.confirm('{{d.id}}','{:url('nono')}','确认拒绝吗？')" class="btn btn-danger btn-xs m-r-xs" title="拒绝"><i class="fa fa-trash">拒绝</i></a>
                        {{# } }}
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
                , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("Tg/shenhe")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
//                {type: 'checkbox', fixed: 'left',}
                  {type:'numbers', width: 70, title: '序号'}
//                , {field: 'active_id', width: 80, title: 'ID', align: 'center'}
                , {field: 'school', width: '', title: '学校名称', align: 'center'}
                , {field: 'usetype', width: '', title: '类型', align: 'center', templet: '#type'}
                , {field: 'money', width: '', title: '支付金额', align: 'center', templet: '#money'}
                , {field: 'year', width: '', title: '年份', align: 'center'}
                , {field: 'startdate', width: '', title: '开始日期', align: 'center'}
                , {field: 'enddate', width: '', title: '结束日期', align: 'center'}
                , {field: 'grade', width: '', title: '年级', align: 'center'}
                , {field: 'time', width: '', title: '最后更新时间', align: 'center'}
                , {field: 'yes',fixed: 'right', width: '', title: '审核状态', align: 'center', templet: '#yes'}
                , {fixed: 'right', width: 250, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]]
            ,done: function (res, curr, count) {
                $('.img-circle').viewer({
                    url: 'data-original',
                });
            }
        });
    });
</script>
</body>
</html>